package com.liwy3.reactor.fun;

/**
 * Copyright © 元气森林（北京）食品科技集团有限公司. All rights reserved.
 *
 * @Description:
 * @author: Crazy4J
 * @date: 2022年03月01日 11:04
 * @version: V1.0
 */
public class MyList<T> {

    private T[] arr;

    public MyList(T[] arr) {
        this.arr = arr;
    }

    public void foreach(MyConsumer<T> myConsumer) {
        for (T str : arr) {
            myConsumer.accept(str);
        }
    }

    public static void main(String[] args) {
        MyList<String> myList = new MyList<>(new String[]{"123","456"});
        myList.foreach(s -> System.out.println(s));
    }
}
